package com.alks.function.mapper.procurement;

import com.alks.entity.data.entity.MpMtlLot;
import com.alks.entity.data.entity.MpPurDis;
import com.alks.function.data.dto.procurement.LotNoDto;
import com.alks.function.data.dto.procurement.PurchaseOrderDto;
import com.alks.function.data.dto.procurement.SummaryMaterialsDto;
import com.alks.function.data.request.procurement.LotAndMtlRequest;
import com.alks.function.data.request.procurement.LotNoRequest;
import com.alks.function.data.request.procurement.LotNoRequest2;
import com.alks.function.data.request.procurement.PurchaseOrderRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface MaterialClearanceMapper extends BaseMapper<MpPurDis> {

    /**
     * 指令明细
     */
    List<LotNoDto> getLotNoList(LotNoRequest request);

    /*汇总材料查询*/
    List<SummaryMaterialsDto> getAllSummaryMaterialsList(@Param("request") LotNoRequest2 request);

    /*汇总材料查询*/
    List<SummaryMaterialsDto> getAllSummaryMaterialsList2(@Param("request") LotNoRequest2 request);

    /*查询采购表有但是订单表没有的材料*/
    List<SummaryMaterialsDto> getAllSummaryMaterialsList3(@Param("request") LotNoRequest2 request);

    /**
     * 我的订购单查询:差异和汇总类型
     */
    List<PurchaseOrderDto> getPurchaseOrderInHzAndCy(@Param("r") PurchaseOrderRequest r);
    List<PurchaseOrderDto> getPurchaseOrderInHzAndCyOrderByLot(@Param("r") PurchaseOrderRequest r);

    /*根据指令查询订购单*/
    List<PurchaseOrderDto> getPurchaseOrder(@Param("r") LotAndMtlRequest request);

    /*要预补数量*/
    List<PurchaseOrderDto> getPurchaseOrderInHzAndCyForQty(@Param("r") PurchaseOrderRequest request);

    /*订购单查询:差异和汇总类型(按照材料排序)*/
    List<PurchaseOrderDto> getPurchaseOrderInHzAndCyOrderMtl(@Param("r") PurchaseOrderRequest request);

    List<PurchaseOrderDto> getPurchaseOrderInHzAndCy2(@Param("r") PurchaseOrderRequest r);

    /*我的订购单*/
    List<PurchaseOrderDto> getPurchaseOrderList(@Param("request") PurchaseOrderRequest request);

    /*进入订购单：指令明细查询*/
    List<MpMtlLot> getPurchaseOrderLotDetail(@Param("request") PurchaseOrderDto request);

    /*指令明细查询*/
    List<String> getAllLotNoList(String lotNo, String companyId);

    /*指令明细查询*/
    List<String> getAllLotNoList2(String lotNo, String companyId);

    /*查询已下单,分组查询已经下单的相同材料的总数量*/
    List<PurchaseOrderDto> getPurchaseOrderInHzAndCyOrderMtl2(String companyId, String lotNo);
}
